package com.yic.module.base.api.erpcentermapping;

import cn.hutool.core.util.StrUtil;
import com.yic.module.base.api.erpcentermapping.dto.ErpCenterMappingRespDTO;
import com.yic.module.base.convert.erpcentermapping.ErpCenterMappingConvert;
import com.yic.module.base.dal.dataobject.erpcentermapping.ErpCenterMappingDO;
import com.yic.module.base.service.erpcentermapping.ErpCenterMappingService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author: Ljx
 * @createTime: 2023年12月21日 13:43:22
 * @version: v1.0.0
 * @Description: ERP映射关系API实现
 */
@Service
public class ErpCenterMappingApiImpl implements ErpCenterMappingApi{

    @Resource
    private ErpCenterMappingService erpCenterMappingService;

    @Override
    public ErpCenterMappingRespDTO getErpCenterMapping(String erpCenterId) {
        if (StrUtil.isBlank(erpCenterId)) {
            return null;
        }
        ErpCenterMappingDO erpCenterMappingDO = erpCenterMappingService.getErpCenterMapping(erpCenterId);
        return ErpCenterMappingConvert.INSTANCE.convert01(erpCenterMappingDO);
    }
}
